package com.itheima.hmshopping.app.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.hmshopping.app.util.GetPage;
import com.itheima.hmshopping.dubbo.api.SmsCouponHistoryServiceApi;
import com.itheima.hmshopping.entity.SmsCouponHistory;
import com.itheima.hmshopping.util.HmPage;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class SmsCouponHistoryService {

    @DubboReference
    private SmsCouponHistoryServiceApi smsCouponHistoryServiceApi;


    //根据优惠券id，使用状态，订单编号分页获取领取记录
    public HmPage list(Integer couponId, String orderSn, Integer pageNum, Integer pageSize, Integer useStatus) {
        Page<SmsCouponHistory> page=smsCouponHistoryServiceApi.page(couponId,orderSn,pageNum,pageSize,useStatus);
        HmPage hmPage = GetPage.getPage(page, pageNum, pageSize);
        return hmPage;
    }
}
